<template>
  <div>
    <!-- {{ classiyfList }} -->
    <van-card
      v-for="item in classiyfList"
      :key="item.id"
      :price="item.price"
      desc="描述信息"
      :title="item.title"
      :thumb="item.img"
    >
      <template #footer>
        <van-button @click="addCount(item)" type="info" size="mini">+</van-button>
      </template>
    </van-card>
  </div>
</template>

<script>
import { mapActions, mapState, mapMutations } from "vuex";
export default {
  computed: {
    ...mapState(["classiyfList"]),
  },
  created() {
    this.init();
  },
  methods: {
    ...mapMutations(['addCarList']),
    ...mapActions(["init"]),
    addCount(item) {
      this.addCarList({
        item
      })
      this.$toast.success('添加成功')
    }
  },
};
</script>

<style>
</style>